//
//  NSUserDefaults+Addition.h
//  BytalkApp
//
//  Created by zhihuiguan on 13-3-18.
//  Copyright (c) 2013年 zhihuiguan. All rights reserved.
//

#import <Foundation/Foundation.h>

//loginUserModel =             {
//    account = 13020000002;
//    "account_type" = 1;
//    deleteflag = 0;
//    devicetype = 4;
//    disable = 0;
//    dredgestatus = 0;
//    groupid = 361;
//    id = 15258;
//    "last_login_time" = "2015-05-20 16:05:40";
//    mobile = 13020000002;
//    name = "\U8d75002";
//    needSync = 0;
//    newVer = 0;
//    orgtreeversion = 308;
//    phonelogin = 0;
//    privacy = 0;
//    pwd = 123456;
//    "register_time" = "2015-04-13 16:20:34";
//    roleno = 472;
//    sex = "-1";
//    sharecount = 1;
//    status = 1;
//    ucreg = 1;
//    updatetime = "2015-05-20T16:11:55";
//};


@interface NSUserDefaults (Addition)
@property (assign, getter=app_rank,
           setter=app_setRank:) NSString *app_rank;
@property (assign, getter=app_showGpTrends,
           setter=app_setShowGpTrends:) NSString *app_showGpTrends;
@property (assign, getter=app_gpTrendsButton,
           setter=app_setGpTrendsButton:) NSString *app_gpTrendsButton;
@property (assign, getter=app_showAreaTrends,
           setter=app_setShowAreaTrends:) NSString *app_showAreaTrends;
@property (assign, getter=app_areaTrendsButton,
           setter=app_setAreaTrendsButton:) NSString *app_areaTrendsButton;



@property (assign, getter=app_privacy,
           setter=app_privacy:) NSString *app_privacy;
//hostAddress: IP地址
@property (assign, getter=app_hostAddress,
           setter=app_setHostAddress:) NSString *app_hostAddress;

//hostname:服务器名称
@property (assign, getter=app_webBaseUrl,
           setter=app_setWebBaseUrl:) NSString *app_webBaseUrl;
@property (assign, getter=app_hostname,
           setter=app_setHostname:) NSString *app_hostname;

@property (assign, getter=app_hostDomain,
           setter=app_setHostDomain:) NSString *app_hostDomain;

@property (assign, getter=app_urlServer,
           setter=app_setUrlServer:) NSString *app_urlServer;

@property (assign, getter=app_uploadUrlServer,
           setter=app_setUploadUrlServer:) NSString *app_uploadUrlServer;

@property (assign, getter=app_ftpServer,
           setter=app_setFtpServer:) NSString *app_ftpServer;

@property (assign, getter=app_ftpUsername,
           setter=app_setFtpUsername:) NSString *app_ftpUsername;

@property (assign, getter=app_ftpPassword,
           setter=app_setFtpPassword:) NSString *app_ftpPassword;

@property (assign, getter=app_userJid,
           setter=app_setUserJid:) NSString *app_userJid;

@property (assign, getter=app_password,
           setter=app_setPassword:) NSString *app_password;

@property (assign, getter=app_poot,
           setter=app_setPoot:) int app_poot;

@property (assign, getter=app_divicetoken,
           setter=app_setDivicetoken:) NSString *app_divicetoken;

@property (assign, getter=app_dataHolder,
           setter=app_setDataHolder:) NSDictionary *app_dataHolder;

@property (assign, getter=app_discussionJid,
           setter=app_setDiscussionJid:) NSString *app_discussionJid;

@property (assign, getter=app_userInfo,
           setter=app_setUserInfo:) NSDictionary *app_userInfo;

@property (assign, getter=app_cookie,
           setter=app_setCookie:) NSData *app_cookie;
@property (assign,getter=app_presenceBroadcaster,
           setter=app_setPresenceBroadcaster:)NSString *app_presenceBroadcaster;
@property (assign, getter=app_autoLogin,
           setter=app_setAutoLogin:)BOOL app_autoLogin;
@property (assign, getter=app_loginid,
           setter=app_setLoginID:)NSString *app_loginid;
@property (assign, getter=app_userNameDomain,
           setter=app_setUserNameDomain:)NSString *app_userNameDomain;
//固定组ID数组
@property (assign, getter=app_bytalkcrowdid,
           setter=app_setBytalkcrowdid:)NSArray *app_bytalkcrowdid;
@property (assign, getter=app_uploadingfiles,
           setter=app_setUploadingFiles:)NSArray *app_uploadingfiles;
@property (assign, getter=app_uploadingfilesforgroupchat,
           setter=app_setUploadingFilesForGroupChat:)NSArray *app_uploadingfilesforgroupchat;
@property (assign, getter=app_wantsfullscreen,
           setter=app_setWantsFullScreen:)BOOL app_setWantsFullScreen;
@property (assign, getter=app_userStatus,
           setter=app_setUserStatus:)NSString *app_userStatus;
@property (assign, getter=app_isHaveSound,
           setter=app_setIsHaveSound:)BOOL app_setIsHaveSound;
//群消息
@property (assign, getter=app_isHaveGroupSound,
           setter=app_setIsHaveGroupSound:)BOOL app_setIsHaveGroupSound;


@property (assign, getter=app_everLaunched,
           setter=app_setEverLaunched:)BOOL app_setEverLaunched;
@property (assign, getter=app_firstLaunched,
           setter=app_setFirstLaunched:)BOOL app_setFirstLaunched;
//头像上传地址
@property (assign, getter=app_avatarUploadURL,
           setter=app_setAvatarUploadURL:)NSString *app_avatarUploadURL;

//头像下载地址
@property (assign, getter=app_avatarDownloadURL,
           setter=app_setAvatarDownloadURL:)NSString *app_avatarDownloadURL;

/**
 * 2013-08-16 Add: 加入建群,发通知的管理判定
 */
//private String icag;   是否可以创建群组
//private String icsn;   是否可以发送通知

#define CAN_CREATE_GROUP_OR_NOTICE  1  // 0:不可以  1：可以

//是否可以创建群组
@property (assign, getter=app_canCreateGroup,
           setter=app_setCanCreateGroup:) NSString *app_canCreateGroup;

// 是否可以发送通知
@property (assign, getter=app_canSendNotice,
           setter=app_setCanSendNotice:) NSString *app_canSendNotice;

//@property (assign, getter=app_groupTreeVersion,
//           setter=app_setGroupTreeVersion:)NSInteger  app_groupTreeVersion;
//用户输入的用户名
@property (assign, getter=app_userInputName,
           setter=app_setUserInputName:) NSString *app_userInputName;
@property (assign, getter=app_icantalk,
           setter=app_setIcantalk:) NSString *app_icantalk;

//- (NSString *)app_bareUserJid ;
@end


//CG_INLINE NSString *  GetUserName()
//{
//    //    NSString *tempUserName = @"";
//    //    NSUInteger startIndex = [[[NSUserDefaults standardUserDefaults] app_userName] rangeOfString:@"@"].location;
//    //    if (startIndex ==NSNotFound) {
//    //        tempUserName =[[NSUserDefaults standardUserDefaults] app_userName];
//    //    } else {
//    //
//    //        tempUserName = [[[NSUserDefaults standardUserDefaults] app_userName] substringToIndex:startIndex];
//    //    }
//    return [[NSUserDefaults standardUserDefaults] app_userInputName];
//}
